import request from '@u/request'
import { HttpMethod } from '@u/http'

// 查询列表
export function listBrand(query) {
  return request({
    url: '/beauty/brand/list',
    method: HttpMethod.GET,
    params: query
  })
}

// 查询
export function getBrand(id) {
  return request({
    url: '/beauty/brand/' + id,
    method: HttpMethod.GET
  })
}

// 新增
export function addBrand(data) {
  return request({
    url: '/beauty/brand',
    method: HttpMethod.POST,
    data: data
  })
}

// 修改
export function updateBrand(data) {
  return request({
    url: '/beauty/brand',
    method: HttpMethod.PUT,
    data: data
  })
}

// 删除
export function delBrand(id) {
  return request({
    url: '/beauty/brand/' + id,
    method: HttpMethod.DELETE
  })
}

// 获取下拉列表
export function getBrandOptionSelect() {
  return request({
    url: '/beauty/brand/getOptionSelect',
    method: HttpMethod.GET
  })
}

// 获取下拉列表
export function getBrandsByProductCategoryId(productCategoryId) {
  return request({
    url: `/beauty/brand/getBrands/${productCategoryId}`,
    method: HttpMethod.GET
  })
}
